/*
 * Scheduler.h
 *
 *      Author: Christian
 *      Letztes Update: 03.11.13 Christian | Code Aufräumen
 *
 */

#ifndef SCHEDULER_H_
#define SCHEDULER_H_

#include <avr/io.h>
#include <avr/interrupt.h>

#include "MPU_6050.h"
#include "Feedback.h"
#include "UART.h"

///////////////////////////////////////////////

#ifndef F_CPU
#define F_CPU 16000000UL
#endif

#define ABTASTZEIT_IN_MS	 	10

#define NEWSENS 		0
#define TMESSUNG 		2
#define PMESSUNG		3

////////////////////////////////////////////////

extern volatile uint8_t status;
/* Status-Variable
 *
 * Die Einzelnen Bits sind status-Flags
 *
 * 	|	7	|	6	|	5	|	4	|	3	|	2	|	1	|	0	|
 * 	|		|		|		|		| PMESS	| TMESS	|		|NEWSENS|
 *
 *
 *
 * 	PMESS: Druck Messung gestartet
 * 	TMESS: Temp Messung gestartet
 * 	NEWSENS: Neue Sensorwerte vom Accelerometer und Gyro vorhanden
 *
 */

extern volatile int16_t sensor_puffer[6];
/*
 * sensor_puffer
 *
 * 	|	0	|	1	|	2	|	3	|	4	|	5	|
 * 	|GYRO_X	|GYRO_Y	|GYRO_Z	|ACCEL_X|ACCEL_Y|ACCEL_Z|
 *
 */

#define NEWSENS 		0

#define TMESSUNG 		2
#define PMESSUNG		3

/////////////////////////////////////////////////

/*	Setzt die Register
 *
 */
void scheduler_start();

void system_pause();

void system_reset();

////////////////////////////////////////////////
#endif /* SCHEDULER_H_ */
